# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Andrew Steinke <rkcf@rkcf.me>

pkgname=python-astunparse
_pkgname=astunparse
pkgrel=7
pkgver=1.6.3
pkgdesc="An AST unparser for Python"
depends=('python' 'python-six')
makedepends=('python-setuptools' 'python-wheel')
url="https://github.com/simonpercivall/astunparse"
license=('python')
arch=('any')
source=("$pkgname-$pkgver.tar.gz::https://github.com/simonpercivall/astunparse/archive/v$pkgver.tar.gz"
        $pkgname-65.patch::https://patch-diff.githubusercontent.com/raw/simonpercivall/astunparse/pull/65.patch)
sha512sums=('8f85d848c65d1728df767b1c2aee44aa4ce79a6810c348a5b3669b56f4bc5ce7f09414557be38d0a5103a77872d75083762bd2829d02ac8414df17221d30492b'
            '69bb59355b0c0999b1fcc8dee4ff241ead9fda84bc159db454473b63bed88310b8ae96e0720b763dd4b9edb7dceaeb8cc9e9af4ff2cb15b60ae39fce7bcdc970')

prepare() {
  cd "$srcdir/$_pkgname-$pkgver"
  patch -Np1 -i "$srcdir"/$pkgname-65.patch
}

build() {
  cd "$srcdir/$_pkgname-$pkgver"
  python setup.py build
}

package() {
  cd "$srcdir/$_pkgname-$pkgver"
  python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim:set ts=2 sw=2 et:
